package com.markyao.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result implements Serializable {
    //前后端数据一致,返回统一的数据
    private Boolean success;

    private String msg;

    private Integer code;

    private Object data;

    public static Result fail(Integer code,String msg){
        return new Result(false,msg,code,null);
    }

    public static Result success(Integer code,String msg,Object data){
        return new Result(true,msg,code,data);
    }
    public static Result success(Object data){
        return new Result(true,"成功",666,data);
    }
}
